<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/vue.js"></script>
</head>
<body>
  <div id="app">
      <my-cpn></my-cpn>
      <my-cpn></my-cpn>
      <my-cpn></my-cpn>
      <my-cpn></my-cpn>
      <cpn></cpn>
      <cpn></cpn>
      <cpn></cpn>
      <cpn></cpn>
  </div>
<br>

  <script>

    const cpnConstructor = Vue.extend({
        template:`
            <div>
                <h2>这是组件的标题</h2>
                <p>这是组件的内容</p>
                <button>这是组件的按钮</button>
            </div>
        `
    })

    Vue.component('my-cpn',cpnConstructor)
    let app = new Vue({
      el:"#app",
      data:{
           msg:'hello world'
       },
       components:{
        'cpn':cpnConstructor
       }
     })
   </script>
</body>
</html>